﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>会员等级</title>
    <meta charset="utf-8" />
    <link href="../themes/default/easyui.css" rel="stylesheet" />
    <link href="../themes/icon.css" rel="stylesheet" />
    <style type="text/css">
        .Main_Shop {
            width: 100%;
            height: 100%;
            background: rgb(224,224,224);
        }
    </style>
    <script src="../Scripts/jquery-1.7.1.js"></script>
    <script src="../Scripts/jquery.min.js"></script>
    <script src="../Scripts/jquery.easyui.min.js"></script>
    <script type="text/javascript">
        $().ready(function () {
            $('#tbMLevel').datagrid({
                fitColumns:true,
                url: '../jquery-easyui-1.4.3/demo/datagrid/datagrid_data1.json',
                method: "get",
                toolbat: "#db",
                pagination: true,
                rownumbers: true,
                singleSelect:true,
                columns: [[
                    { field: 'code', title: '会员卡号', width: 100 },
                    { field: 'name', title: '会员姓名', width: 100 },
                    { field: 'price', title: '手机号码', width: 100 },
                    { field: 'name', title: '累计消费', width: 100 },
                    { field: 'price', title: '会员卡状态', width: 100 },
                     { field: 'name', title: '当前积分', width: 100 },
                    { field: 'price', title: '性别', width: 100 },
                    { field: 'name', title: '登记时间', width: 100 },
                    { field: 'price', title: '当前等级', width: 100 }
                ]]
            });
            //新增
            $("#btnAdd").click(function () {
                $("#dlg").dialog({ width: 800, height: 500, left: 400, top: 0 })
                .dialog("setTitle", "新增会员")
                .dialog("open");
                $("#frm1").attr("src","AddMember.html");
            });
            //修改
            $("#btnUpdate").click(function () {
                var row = $("#tbMLevel").datagrid("getSelected");
                if (row != null)
                {
                    $("#dlg").dialog({ width: 800, height: 500, left: 400, top: 0 })
               .dialog("setTitle", "编辑会员")
               .dialog("open");
                    $("#frm1").attr("src", "AddMember.html");
                }
                else
                {
                    alert('请先选择所需修改的会员信息');
                }
            });
            //删除
            $("#btnDel").click(function () {
                var row = $("#tbMLevel").datagrid("getSelected");
                if (row != null) {
                    if (confirm('确定要删除此会员吗？'))
                    { }
                }
                else {
                    alert('请选择所需删除的会员');
                }
            });
            //挂失/锁定
            $("#btnLuckUnluck").click(function () {
                var row = $("#tbMLevel").datagrid("getSelected");
                if (row != null) {
                    $("#dlg").dialog({ width: 400, height: 200, left: 400, top: 0 })
           .dialog("setTitle", "挂失/锁定")
           .dialog("open");

                    $("#frm1").attr("src", "lockUnlockMember.html");
                }
                else {
                    alert('请选择所需挂失的会员信息');
                }
            });
            //转账
            $("#btnChangeMooney").click(function () {
                var row = $("#tbMLevel").datagrid("getSelected");
                if (row != null) {
                    $("#dlg").dialog({ width: 600, height: 500, left: 400, top: 0 })
 .dialog("setTitle", "会员转账")
 .dialog("open");
                    $("#frm1").attr("src", "MemberZhuanzhang.html");
                }
                else {
                    alert('请选择所需转账的会员信息');
                }
            });
            //换卡
            $("#btnChangeCard").click(function () {
                var row = $("#tbMLevel").datagrid("getSelected");
                if (row != null) {
                    $("#dlg").dialog({ width: 600, height: 500, left: 400, top: 0 })
 .dialog("setTitle", "会员换卡")
 .dialog("open");

                    $("#frm1").attr("src", "MemberHuan.html");
                }
                else {
                    alert('请选择所需换卡的会员信息');
                }
            });
        });
    </script>
</head>
<body>
    <div class="Main_Shop">
        <!-- 按钮 -->
        <div id="db">
            <a id="btnAdd" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'">新增</a>
            <a id="btnUpdate" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">修改</a>
            <a id="btnDel" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove'">删除</a>
            <a id="btnLuckUnluck" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-lock'">挂失/锁定</a>
            <a id="btnChangeMooney" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">会员转账</a>
            <a id="btnChangeCard" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-sum'">会员换卡</a>
            <a id="btnComeExcel" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-redo'">导出Excel</a>
            <a id="btnGoExcel" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-undo'">导入Excel</a>
        </div>
        <!--查询  -->
        <div>
            <label for="name">会员卡号:</label>
            <input class="easyui-textbox" type="text" name="txtMemberCardID"></input>
            <label for="name">会员姓名:</label>
            <input class="easyui-textbox" type="text" name="txtMemberName"></input>
            <label for="name">会员电话:</label>
            <input class="easyui-textbox" type="text" name="txtMemberTel"></input>
            <label for="name">等级:</label>
            <td><select class="easyui-combobox" name="language"><option>请选择</option></select></td>
            <label for="name">状态:</label>
            <td><select class="easyui-combobox" name="language"><option>请选择</option></select></td>

            <a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a>
        </div>
        <div id="dlg" class="easyui-dialog" data-options="closed:true" style="margin-top:0px;overflow:hidden; ">
            <iframe id="frm1" width="100%" height="99%" frameborder="0"></iframe>
        </div>
        <table id="tbMLevel"></table>
    </div>
</body>
</html>
